<script setup lang="ts">
import { ElCard, ElButton } from "element-plus";
import { useRouter } from "vue-router";
import { useUserStore } from "@/store/modules/user";
const { replace } = useRouter();
const userStore = useUserStore();
// 返回首页
const toHome = () => {
  replace("/");
};

// 重新登录
const toLogin = () => {
  userStore.logout();
  replace("/login");
};
</script>

<template>
  <ElCard>
    <h1>出错了</h1>
    <h2>请联系管理员</h2>
    <ElButton @click="toHome">尝试返回首页</ElButton>
    <ElButton @click="toLogin">重新登录账号</ElButton>
  </ElCard>
</template>

<style lang="less" scoped></style>
